package com.qzsoft.zhjd.asphalt.modules.asphaltoutputstatistics.service.impl;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.qzsoft.zhjd.asphalt.modules.asphaltoutputstatistics.dto.AsphaltOutputPieDto;
import com.qzsoft.zhjd.asphalt.modules.asphaltoutputstatistics.dto.AsphaltOutputStatisticsDto;
import com.qzsoft.zhjd.asphalt.modules.asphaltoutputstatistics.mapper.AsphaltOutputStatisticsMapper;
import com.qzsoft.zhjd.asphalt.modules.asphaltoutputstatistics.service.AsphaltOutputStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qzsoft.zhjd.common.annotation.ZhjdDataFilter;

/**
 * @ClassName AsphaltOutputStatisticsServiceImpl
 * @Description 沥青产量统计分析业务接口实现
 * @author linhuawei
 * @since 2022-04-23
 */
@Service
public class AsphaltOutputStatisticsServiceImpl implements AsphaltOutputStatisticsService {

    @Autowired
    private AsphaltOutputStatisticsMapper asphaltOutputStatisticsMapper;

    @Override
    @ZhjdDataFilter
    public List<AsphaltOutputStatisticsDto> listForYear(Map<String, Object> params) {
        return asphaltOutputStatisticsMapper.listForYear(params);
    }

    @Override
    @ZhjdDataFilter
    public List<AsphaltOutputStatisticsDto> listForMonth(Map<String, Object> params) {
        return asphaltOutputStatisticsMapper.listForMonth(params);
    }

    @Override
    @ZhjdDataFilter
    public List<AsphaltOutputStatisticsDto> listForDay(Map<String, Object> params) {
        return asphaltOutputStatisticsMapper.listForDay(params);
    }

    @Override
    @ZhjdDataFilter
    public AsphaltOutputPieDto listForProject(Map<String, Object> params) {
        List<AsphaltOutputStatisticsDto> list = asphaltOutputStatisticsMapper.listForProject(params);
        BigDecimal total = asphaltOutputStatisticsMapper.getTotal(params);
        AsphaltOutputPieDto dto = new AsphaltOutputPieDto();
        dto.setList(list);
        dto.setTotal(total);
        return dto;
    }

    @Override
    @ZhjdDataFilter
    public AsphaltOutputPieDto listForMatch(Map<String, Object> params) {
        List<AsphaltOutputStatisticsDto> list = asphaltOutputStatisticsMapper.listForMatch(params);
        BigDecimal total = asphaltOutputStatisticsMapper.getTotal(params);
        AsphaltOutputPieDto dto = new AsphaltOutputPieDto();
        dto.setList(list);
        dto.setTotal(total);
        return dto;
    }

}
